<h1>Sprawdzenie poprawności wyniku</h1>

<% form_for(@new_examination_resoult) do |f| %>
 <p>
    Typ badania: <%=@new_examination_resoult.order_examination.examination_type.name %>
    <br/>
    Nr. zlecenia: <%=@new_examination_resoult.order_examination_id %>
  </p>
  <p>
    Płeć pacjenta: <%=@new_examination_resoult.order_examination.patient_data.sex.name %>
    <br/>
    Data urodzenia: <%=@new_examination_resoult.order_examination.patient_data.birth_date %>
  </p>
  <p>
    Komentarz do badania:<br/>
    <%= f.text_area :description %>
    <%= f.hidden_field :user_id %>
    <%= f.hidden_field :order_examination_id %>
  </p>
  <p>
    Parametry
  </p>

  <table title="Parametry">
    <tr>
      <th>Nazwa</th>
      <th>Wynik</th>
      <th>Norma</th>
      <th>Komentarz</th>
    </tr>

    <%for param_resoult in @new_examination_resoult.param_resoults%>
      <%fields_for "temp_examination_resoult[param_resoult_attributes][]", param_resoult do |param_resoult_form| %>
        <tr>
          <td><%=param_resoult.param_norm.name%> </td>
          <td><%=param_resoult.resoult %> </td>
          <td><%=param_resoult.param_norm.min_norm%> -
              <%=param_resoult.param_norm.max_norm%>
              [<%=param_resoult.param_norm.unit%>]
          </td>
          <td><%= param_resoult_form.check_box :is_ok, :index => nil%> </td>
          <td><%= param_resoult_form.text_field :description, :index => nil%> </td>
          <td> <%= param_resoult_form.hidden_field :resoult, :index => nil%>
            <%= param_resoult_form.hidden_field :param_norm_id, :index => nil %>
            <%= param_resoult_form.hidden_field :id, :index => nil %>
          </td>
        </tr>
      <% end %>
    <% end %>
  </table>
  <p>
    <%= submit_tag  'Zatwierdź', :name => 'confirm_button'%>
  </p>
  <p>
    <%= submit_tag 'Zleć ponowne wykonanie', :name => 'decline_button'%>
  </p>
<% end %>

TODO: przycisk powrotu
<%#= link_to 'Back', temp_examination_resoults_path %>